package com.bdqn.t382.sz;

import java.util.Date;

public class Person {
    private String name;
    private int age;
    private Date birthDate;

    public Person() {

    }

    public Person(String name, int age, Date birthDate) {
        this.name = name;
        this.age = age;
        this.birthDate = birthDate;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", birthDate=" + birthDate +
                '}';
    }
    public void introduce() {
        System.out.println("My name is " + name + ", I'm " + age + " years old.");
    }
    // 自定义带参数的实例方法
    public void celebrateBirthday(int years) {
        this.age += years;
        System.out.println("I'm now " + age + " years old after " + years + " years.");
    }
    // 自定义静态方法
    public static void sayHello() {
        System.out.println("Hello from Person class!");
    }
}
